﻿
@{
    ViewBag.Title = "修改管理员";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using Mate.Framework.Extensions
@model Mate.Db.Model.Users.admin_user
@section styles{

}
@section scripts{
    <script src="~/bootstrap/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
    <script src="~/bootstrap/plugins/jquery-validation/dist/additional-methods.min.js"></script>
    <script src="~/bootstrap/scripts/custom/form-validation.js" charset="gbk"></script>

    <script src="~/js/admin.js?v=1.0"></script>
    <script language="javascript" type="text/javascript">
    $(function () {
        var rules = {
            user_no: {
                required: true
            },
            user_name: {
                required: true
            },
            password: {
                required: true
            }
        };
        FormValidation.BasicValidation(rules);

    });
    </script>
}

<ul class="page-breadcrumb breadcrumb">
    <li>
        <a href="@Url.Action("Index","AdminUser")">
            管理员管理
        </a>
        <i class="fa fa-angle-right"></i>
    </li>
    <li>
        修改管理员
    </li>
</ul>

<div class="row">
    <div class="col-md-12">

        <div class="portlet-body form">
            <!-- BEGIN FORM-->
            @using (Html.BeginForm("Edit", "AdminUser", FormMethod.Post, new { @class = "form-horizontal", @id = "form_ff_validation", @novalidate = "novalidate" }))
            {
                <div class="form-body">
                    @Html.TextFor("账号", "user_no",value:Model.user_no,isReadonly:true)
                    @Html.TextFor("姓名", "user_name", value: Model.user_name)
                    <div class="form-group">
                        <label class="control-label col-sm-3">
                            角色
                            <span class="required">*</span>
                        </label>
                        <div class="col-sm-4">
                            <select id="roles_id" name="roles_id" class="form-control">
                                @foreach (var item in ViewBag.Roles as List<Mate.Db.Model.System.roles>)
                                {
                                    <option value="@item.id" @(Model.roles_id==item.id?"selected='selected'":"")>@item.role_name</option>
                                }
                            </select>
                        </div>
                    </div>
                    @Html.SexSelectFor("性别", "sex",optionValue:(Model.sex??0).ToString(), isSelect: false)
                    @Html.TextFor("手机号", "phone",value:Model.phone, required: false)
                    @Html.EnableRadioFor(selectValue:Model.is_enable.ToString())
                </div>
                <div class="form-actions fluid">
                    <div class="col-md-offset-3 col-md-9">
                        @Html.HiddenFor(x=>x.id)
                        <button class="btn green" type="button" onclick="admin.AddSubmit('@Url.Action("Index")')"> 提交 <i class="fa fa-check"></i> </button>
                        <a class="btn default" role="button" href="@Url.Action("Index")"> 返回 <i class="fa fa-reply"></i></a>
                    </div>
                </div>
            }
            <!-- END FORM-->
        </div>
    </div>
    <!-- END VALIDATION STATES-->
</div>
